# -*- coding: utf-8 -*-

from vialink.django.gridcrud import *

from sgr.models import Recurso
from sgr.forms import RecursoForm, RecursoEditForm

class RecursoGridCrud(GridCrud):
    numero = FieldFormatter(field='id')
    tipo = FieldFormatter()
    nome = FieldFormatter()
    descricao = FieldFormatter()
    capacidade = FieldFormatter()
    status = FieldFormatter()

    class Meta:
        model = Recurso
        form = RecursoForm
        template = 'sgr/recurso/partial/recurso_form.html'


    def form(self, request, **kwargs):
        self._meta.form_add =  RecursoForm
        self._meta.form_edit = RecursoEditForm
        return super(RecursoGridCrud, self).form(request, **kwargs)
